<?PHP
global $conf;

foreach($_POST as $post_key => $value)
{

	$haystack = $post_key;
	$needle = '_';
	$result = substr($haystack, 0, strpos($haystack, $needle));	

	if($result=='contact')
	{
	$y[$post_key]=$_POST[$post_key];	
	}
	$whatpostkey = str_replace("contact", "", $post_key);
	$whatpostkey = str_replace("_", " ", $whatpostkey);
	$whatpostkey = ucwords($whatpostkey);
//	echo $whatpostkey." : ".$_POST[$post_key]."<br />";
	
	$mailer->mail_data .=$whatpostkey." : ".$_POST[$post_key]."<br />";
}
//echo 	$mailer->mail_data;

$mailer->mail_name=$conf->a['site-name'];
$mailer->mail_to=$conf->a['contact-form-recepient'];
$mailer->mail_sender=$_POST['contact_first_name'].' '.$_POST['contact_last_name'];
$mailer->mail_from=$_POST['contact_email'];
$mailer->mail_message=$mailer->mail_data;
$mailer->mail_subject='Message from: '.$_POST['contact_first_name'].' '.$_POST['contact_last_name'];
$mailer->mail_reply_to=$conf->a['reply-to'];



?>